//
//  AccountManage.m
//  ArtCircle
//
//  Created by sunbin on 2017/5/20.
//  Copyright © 2017年 HuaYue. All rights reserved.
//

#import "AccountManage.h"

@implementation AccountManage

single_implementation(AccountManage);

- (void)request:(NetOperating)ty apiTy:(AccountAPI)api params:(NSDictionary *)params success:(void (^)(NSDictionary * results, NSString* successMsg))success failed:(void(^)(WrapperEnumError errorty ,NSString *msg))failed {


    
    NSArray *apiAry =
    ty==Request?
    @[Server_CodeRegister ,Server_Getcode   ,Server_AppLogin ,Server_Findpsw]:
    @[Server_Register     ,Server_CodeLogin ,Server_AppLogin ,Server_UpdatePassword];

    NSLog(@"%@" ,[SERVER_HOST stringByAppendingString:apiAry[api]]);
    
    
    [ZL_NetworkHelper POST:[SERVER_HOST stringByAppendingString:apiAry[api]] parameters:params success:^(id responseObject) {
        
        
        [(NSDictionary *)responseObject server_Getcodecheck]?success([responseObject objectForKey:@"data"],IF_NULL_TO_STRING([responseObject objectForKey:@"msg"])):failed(Error,[responseObject objectForKey:@"msg"]);
        

        
    } failure:^(NSError *error) {
        failed(Failure ,error.localizedDescription);

    }];
    
    
    
}


@end
